import { defineStore } from 'pinia'
import type { AddressItem } from '@/types/address'
import { ref } from 'vue'

export const useAddressesStore = defineStore('address', () => {
  // 选中的地址
  const selectAddres = ref<AddressItem>()
  // 修改选中地址
  const changeSelectedAddress = (address: AddressItem | undefined) => {
    selectAddres.value = address
  }
  return {
    selectAddres,
    changeSelectedAddress,
  }
})
